package designpattern.single.StaticInsideClass;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Client {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
//        StaticInsideClassSingleton instance = StaticInsideClassSingleton.getInstance();
//        System.out.println(instance);

        Class<?> clazz = StaticInsideClassSingleton.class;
        Constructor<?> constructor = clazz.getDeclaredConstructor(null);

        constructor.setAccessible(true);

        StaticInsideClassSingleton o1 = (StaticInsideClassSingleton)constructor.newInstance();
        StaticInsideClassSingleton o2 = (StaticInsideClassSingleton)constructor.newInstance();

        System.out.println(o1);
        System.out.println(o2);
        System.out.println(o1 == o2);
    }
}
